import { defineStore } from "pinia";
import { ref, onMounted } from 'vue'
import axios from 'axios'
export const useAuthorStore = defineStore('authorStore', () => {
    const author_data = ref(null)
    const blog_data = ref(null)
    const list_data = ref(null)
    onMounted( async () => {
        const { data } = await axios.get('/src/assets/data/index.json')
        author_data.value = data
    })
    onMounted( async () => {
        const { data } = await axios.get('/src/assets/data/blog.json')
        blog_data.value = data
    })
    onMounted( async () => {
        const { data } = await axios.get('/src/assets/data/list.json')
        list_data.value = data
    })
    return {
        author_data,
        blog_data,
        list_data
    }
})